package com.slz3.business.module.systemManagement.sysFunction.steward;

import com.slz3.business.module.systemManagement.sysFunction.domain.SysFunction;
import com.slz3.business.module.systemManagement.sysFunction.domain.SysFunctionCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysFunctionResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(SysFunction.class).flatMap(sysFunction ->
                SysFunctionResController.add(req, sysFunction)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(SysFunctionCondition.class).flatMap(sysFunctionCondition ->
                SysFunctionResController.delete(req, sysFunctionCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(SysFunction.class).flatMap(sysFunction ->
                SysFunctionResController.modify(req, sysFunction)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return SysFunctionResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return SysFunctionResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return SysFunctionResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(SysFunctionCondition.class).flatMap(sysFunctionCondition ->
                SysFunctionResController.auditSubmit(req, sysFunctionCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(SysFunctionCondition.class).flatMap(sysFunctionCondition ->
                SysFunctionResController.audit(req, sysFunctionCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(SysFunctionCondition.class).flatMap(sysFunctionCondition ->
                SysFunctionResController.auditReject(req, sysFunctionCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(SysFunctionCondition.class).flatMap(sysFunctionCondition ->
                SysFunctionResController.usingEnable(req, sysFunctionCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(SysFunctionCondition.class).flatMap(sysFunctionCondition ->
                SysFunctionResController.usingDisable(req, sysFunctionCondition)
        );
    }   

}
